package com.wuchao.Enum;



/**
 * @author wu
 * @create 2021-08-25-16:17
 */
abstract class Bird {
    public  abstract Desc.Color getColor();
}

class Sparrow extends  Bird{
    private Desc.Color color;

    public  Sparrow(){
        color = Desc.Color.Yellow;
    }
    public Sparrow(Desc.Color  _color){
        color = _color;
    }

    @Override
    public Desc.Color getColor() {
        return color;
    }
}

enum BirdNest{
    Sparrow;
    public Bird reproduce(){
         Desc de = com.wuchao.Enum.Sparrow.class.getAnnotation(Desc.class);
        return de  == null?new Sparrow() : new Sparrow(de.c());
    }
}
